use super::common::ErrorResult;
use std::future::Future;

/// Only responsible for establishing connections, data should be parsed through a parser
/// And perform route matching based on the results returned by the parser
/// -----------------------------------------------------------------
/// If you want to customize the Protocol, you need to implement this Trap to ensure that it can be recognized by the server module
pub trait ProtocolTrait: Send {
    fn listen(&self) -> impl Future<Output = Result<(), ErrorResult>> + Send;
}
